<template>
	<view>
		<u-popup v-model="showChangePwd" mode="center" border-radius="12" width="650">
			<view class="change_box">
				<view class="change_title">
					修改密码
				</view>

				<view class="change_password_all">
					<view class="change_password_title">
						旧密码
					</view>
					<view class="change_password_input">
						<u-input v-model="passwordObj.old_pwd" type="password" :border="false" :clearable="false"
							placeholder="请输入旧密码" />
					</view>
				</view>

				<view class="change_password_all">
					<view class="change_password_title">
						新密码
					</view>
					<view class="change_password_input">
						<u-input v-model="passwordObj.new_pwd" type="password" :border="false" :clearable="false"
							placeholder="请输入新密码" />
					</view>
				</view>

				<view class="submit_btn" @click="handleSubmit">
					提 交
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script>
	import {
		Debounce,
		Throttle
	} from '@/utils/common.js'
	export default {
		data() {
			return {
				showChangePwd: false,
				showChangePwd: false,
				passwordObj: {
					old_pwd: '',
					new_pwd: ''
				}
			}
		},
		methods: {
			// 提交
			handleSubmit: Throttle(function() {
				if (this.passwordObj.old_pwd == '') {
					uni.showToast({
						title: '请输入旧密码',
						icon: 'none'
					})
					return
				} else if (this.passwordObj.new_pwd == '') {
					uni.showToast({
						title: '请输入新密码',
						icon: 'none'
					})
					return
				} else {
					this.$emit('handleSubmit', this.passwordObj)
				}
			}, 4000)
		}
	}
</script>
<style lang="scss" scoped>
	.change_box {
		padding: 30rpx;

		.change_title {
			text-align: center;
			font-size: 34rpx;
			font-family: all-font;
		}

		.change_password_all {
			padding-top: 30rpx;

			.change_password_title {
				font-family: Source Han Sans CN;
				font-weight: 500;
				font-size: 32rpx;
				font-family: all-font;
				color: #333333;
				padding-bottom: 26rpx;
			}

			.change_password_input {
				height: 79rpx;
				background: #F7F9FD;
				border-radius: 14rpx;
				border: 1px solid #EBEBEB;
				padding-left: 35rpx;
			}
		}

		.submit_btn {
			display: flex;
			align-items: center;
			justify-content: center;
			height: 79rpx;
			background: #0E255B;
			border-radius: 14rpx;
			font-family: Source Han Sans CN;
			font-weight: 500;
			font-size: 30rpx;
			font-family: all-font;
			color: #FFD79A;
			margin-top: 70rpx;
		}
	}
</style>